
#include "node.h"

#include "config.h"
#include "error.h"

namespace eqPc
{
bool Node::configInit( const eq::uint128_t& initID )
{
    // All render data is static or multi-buffered, we can run asynchronously
    if( getIAttribute( IATTR_THREAD_MODEL ) == eq::UNDEFINED )
        setIAttribute( IATTR_THREAD_MODEL, eq::ASYNC );

    if( !eq::Node::configInit( initID ))
        return false;

    Config* config = static_cast< Config* >( getConfig( ));
    if( !config->mapData( initID ))
    {
        setError( ERROR_EQPLY_MAPOBJECT_FAILED );
        return false;
    }
    return true;
}

bool Node::configExit()
{
    Config* config = static_cast< Config* >( getConfig( ));
    config->unmapData();
    
    return eq::Node::configExit();
}

}
